package com.ruoyi.cs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cs.domain.TBattleBox;
import com.ruoyi.cs.mapper.TBattleBoxMapper;
import com.ruoyi.cs.service.ITBattleBoxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 对战所参与的盲盒Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-05
 */
@Service
@SuppressWarnings("all")
public class TBattleBoxServiceImpl implements ITBattleBoxService
{
    @Autowired
    private TBattleBoxMapper tBattleBoxMapper;

    /**
     * 查询对战所参与的盲盒
     * 
     * @param battleboxId 对战所参与的盲盒ID
     * @return 对战所参与的盲盒
     */
    @Override
    public TBattleBox selectTBattleBoxById(String battleboxId)
    {
        return tBattleBoxMapper.selectTBattleBoxById(battleboxId);
    }

    /**
     * 查询对战所参与的盲盒列表
     * 
     * @param tBattleBox 对战所参与的盲盒
     * @return 对战所参与的盲盒
     */
    @Override
    public List<TBattleBox> selectTBattleBoxList(TBattleBox tBattleBox)
    {
        return tBattleBoxMapper.selectTBattleBoxList(tBattleBox);
    }

    /**
     * 新增对战所参与的盲盒
     * 
     * @param tBattleBox 对战所参与的盲盒
     * @return 结果
     */
    @Override
    public int insertTBattleBox(TBattleBox tBattleBox)
    {
        tBattleBox.setCreateTime(DateUtils.getNowDate());
        return tBattleBoxMapper.insertTBattleBox(tBattleBox);
    }

    /**
     * 修改对战所参与的盲盒
     * 
     * @param tBattleBox 对战所参与的盲盒
     * @return 结果
     */
    @Override
    public int updateTBattleBox(TBattleBox tBattleBox)
    {
        tBattleBox.setUpdateTime(DateUtils.getNowDate());
        return tBattleBoxMapper.updateTBattleBox(tBattleBox);
    }

    /**
     * 批量删除对战所参与的盲盒
     * 
     * @param battleboxIds 需要删除的对战所参与的盲盒ID
     * @return 结果
     */
    @Override
    public int deleteTBattleBoxByIds(String[] battleboxIds)
    {
        return tBattleBoxMapper.deleteTBattleBoxByIds(battleboxIds);
    }

    /**
     * 删除对战所参与的盲盒信息
     * 
     * @param battleboxId 对战所参与的盲盒ID
     * @return 结果
     */
    @Override
    public int deleteTBattleBoxById(String battleboxId)
    {
        return tBattleBoxMapper.deleteTBattleBoxById(battleboxId);
    }
}
